﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Numbers
{
    public class Alpha : INotifyPropertyChanged
    {
        /// <summary>
        /// Get the value for alpha b
        /// </summary>
        public Value alpha_bValue
        {
            get { return _alpha_b; }
        }

        /// <summary>
        /// Get the value for alpha c
        /// </summary>
        public Value alpha_cValue
        {
            get { return _alpha_c; }
        }

        /// <summary>
        /// Get the value for alpha l
        /// </summary>
        public Value alpha_lValue
        {
            get { return _alpha_l; }
        }

        internal Value _alpha_b = new Value() { Val = 1.0 };
        internal Value _alpha_c = new Value() { Val = 1.0 };
        internal Value _alpha_l = new Value() { Val = 1.0 };

        public double alpha_b { get { return _alpha_b.Val; } set { _alpha_b.Val = value; } }
        public double alpha_c { get { return _alpha_c.Val; } set { _alpha_c.Val = value; } }
        public double alpha_l { get { return _alpha_l.Val; } set { _alpha_l.Val = value; } }

        public Alpha()
        {
            ///
            /// When one of our property's change, we should let everyone know!
            /// 

            _alpha_b.PropertyChanged +=new PropertyChangedEventHandler((o, args) => OnPropertyChanged("alpha_b"));
            _alpha_c.PropertyChanged += new PropertyChangedEventHandler((o, args) => OnPropertyChanged("alpha_c"));
            _alpha_l.PropertyChanged += new PropertyChangedEventHandler((o, args) => OnPropertyChanged("alpha_l"));
        }

        /// <summary>
        /// Notify the world that a property has changed.
        /// </summary>
        /// <param name="propName"></param>
        private void OnPropertyChanged(string propName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
            }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion
    }
}
